<template>
  <countTo
    :start-val="startVal"
    :end-val="endVal"
    :duration="duration"
    :decimals="decimals"
    :autoplay="autoplay"
    :prefix="prefix"
    :suffix="suffix"
    :separator="separator"
    :decimal="decimal"
    :delay="delay"
    @mountedCallback="mountedCallback"
  />
</template>

<script>
import countTo from 'vue-count-to';

export default {
  name: 'CountTo',
  components: { countTo },
  props: {
    startVal: {
      type: Number,
      default: 0
    },
    endVal: {
      type: Number,
      required: true
    },
    duration: {
      type: Number,
      default: 2000
    },
    decimals: {
      type: Number,
      default: 0
    },
    autoplay: {
      type: Boolean,
      default: true
    },
    prefix: {
      type: String,
      default: ''
    },
    suffix: {
      type: String,
      default: ''
    },
    separator: {
      type: String,
      default: ','
    },
    decimal: {
      type: String,
      default: '.'
    },
    delay: {
      type: Number,
      default: 0
    }
  },
  methods: {
    mountedCallback() {
      this.$emit('mounted');
    }
  }
};
</script> 